package com.highbury5.blog.service;

import com.highbury5.blog.util.redis.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import redis.clients.jedis.JedisCluster;

@Service
public class LikeService {

    @Autowired
    RedisUtil redisUtil;

    public String add(int articleId){
        String key = "like_" + articleId;
        redisUtil.incr(key);
        String count = redisUtil.get(key);
        return count;
    }

    public String get(int articleId){
        String key = "like_" + articleId;
        String count = redisUtil.get(key);
        return count;
    }

}
